Search CTRL + K

How to Add a New Font to Obsidian

Following the guide in this Reddit post, as below:

  1. Convert the font file to CSS through this website https://hellogreg.github.io/woff2base/ or https://www.fontconverter.io/en/css-embedded-font-base64.
  2. Make sure the CSS font property contains font-family: "{fontName}"
  3. Place the generated CSS file in Obsidian snippets folder .obsidian/snippets
  4. In Obsidian Settings/Appearance
    1. Enable the CSS file, under CSS snippets,
    2. in Text Font, enter the font name placed in the CSS under font-family
@font-face {
	font-family: '{font-name}';
	src: url(......)
}

While if you want to set a specific font to a specific language, you could use unicode-range CSS property, so the font is applied to specific set of characters. For example, for Arabic language that includes every possible Arabic character:

@font-face {
	font-family: '{font-name}';
	unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB1E-FB4F, U+FB50-FDFF, U+FE70-FEFF;
	src: url(......)
}

And you could change the Font size for this specific font by adding size-adjust CSS property

@font-face {
	font-family: '{font-name}';
	unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB1E-FB4F, U+FB50-FDFF, U+FE70-FEFF;
	size-adjust: 120%;
	src: url(......)
}